new Vue({
    el: '#app',
    mixins: [Save],//组件配置文件，路径/utils/components.js
    data() {
        return {
            dataForm:{},

            land_info:[],
            crop:[],
            planting_people:[],
            city: [],//地址
            type:'0',//0:可修改  1:只读
            growth_stage:[],//生育期json
            Operation_Type:[]  //操作类型json
        }
    },
    mounted() {
        /**
         * 组件配置文件中自动执行方法
         * 1.this.init(); //初始化文件
         * 2.this.getData(); //仅修改时执行，根据BOM配置属性查询
         */
       console.log(createUniqueString() );
        
        let ls_URL = window.location.href;
        this.type = getQueryObject(ls_URL, "type") || '0';
        this.getList();
    },
    methods: {      
        getList(){
           httpRequest({ //地块
                url: '/generalBusiness/generalQueryByTableName',
                data: {
                    Data: 'land_info',
                    Condition: `Row_Status='0'`
                },
                type:'GET'
            }).then(data => {
               this.land_info = data;
            }).catch(xhr => {
                this.$message.error("系统错误，请联系开发者!")
            })
            httpRequest({ //作物
                url: '/generalBusiness/generalQueryByTableName',
                data: {
                    Data: 'crop',
                    Condition: `Row_Status='0'`
                },
                type:'GET'
            }).then(data => {
               this.crop = data;
            }).catch(xhr => {
                this.$message.error("系统错误，请联系开发者!")
            })
            httpRequest({ //种植人
                url: '/generalBusiness/generalQueryByTableName',
                data: {
                    Data: 'planting_people',
                    Condition: `Row_Status='0'`
                },
                type:'GET'
            }).then(data => {
               this.planting_people = data;
            }).catch(xhr => {
                this.$message.error("系统错误，请联系开发者!")
            })
            //操作类型
            $.ajax({
                url: absolutepath() + 'admin/data/Operation_Type.json',
                type: 'GET',
                success: (data) => {
                    this.Operation_Type = data;
                },
            })
            //生育期
            $.ajax({
                url: absolutepath() + 'admin/data/growth_stage.json',
                type: 'GET',
                success: (data) => {
                    this.growth_stage = data;
                },
            })
        },
        handleDate(val, item) { //处理空指针
            if (val == null) {
                item.Operation_Date = '';
            }
        }
      
    }
})